package cn.org.rookie.jeesdp.core.utils;

import org.springframework.web.client.RestTemplate;

import java.util.Map;

/**
 * @author LHT
 * @date 2022-10-28 21:29
 */

public class HttpUtils extends BaseUtils {

    private static RestTemplate restTemplate;

    @Override
    public void afterPropertiesSet() {
        restTemplate = applicationContext.getBean(RestTemplate.class);
    }

    public <T> T post(String url, Map<String, Object> param, Class<T> type) {
        return restTemplate.postForObject(url, param, type);
    }

}
